import pathToRegexp from 'path-to-regexp/index';
import {getPlanValue} from 'services/app';
export default {
    namespace: 'pointplanVale',
    state: {
        bodyWidth:document.body.clientWidth,
    },
    subscriptions: {
        setupHistory ({ dispatch, history }) {
            history.listen((location) => {
                const match = pathToRegexp('/home').exec(location.pathname);
            });
        },
        setup ({ dispatch }) {},
    },
    effects: {
        //查看登录状态
        *getPlanValue ({ payload }, { call, put }){
            const {data,total} = yield call(getPlanValue, payload);
            yield put({ type: 'save', payload: {getPlanValueData:data,total:total,pages:payload.pageNumber}});
        },
    },
    reducers: {
        save (state, { payload }) {
            return { ...state, ...payload };
        },
    },
};
